<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>博客系统-后台管理</title>
    <link rel="stylesheet" href="./public/admin/css/pintuer.css">
    <link rel="stylesheet" href="./public/admin/css/admin.css">
    <script src="./public/admin/js/jquery.js"></script>
    <script src="./public/admin/js/pintuer.js"></script>
    <script src="./public/admin/js/respond.js"></script>
    <script src="./public/admin/js/admin.js"></script>
    <script type="text/javascript" src="./public/admin/js/wangEditor.min.js"></script>
    <link rel="stylesheet" href="./public/admin/css/wangEditor.min.css">
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>

<body>
<div class="lefter">
    <div class="logo"><a href="#" target="_blank"><img src="./public/admin/images/logo.png" alt="后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
                <a class="button button-little bg-main" href="/" target="_blank">前台首页</a>
                <a class="button button-little bg-yellow" href="?p=admin&c=Land&a=Out">注销登录</a>
            </span>
            <ul class="nav nav-inline admin-nav">
                <li class="active"><a href="?p=admin" class="icon-home"> 开始</a>
                    <ul>
                        <li class="active"><a href="?p=admin&c=Class&a=List">分类管理</a></li>
                        <li class="active" ><a href="?p=admin&c=Article&a=List">文章管理</a></li>
                        <li class="ax"><a href="?p=admin&c=Mege&a=List">留言管理</a></li>
                        <li class="ax"><a href="?p=admin&c=Setup&a=List">站点管理</a></li>
                        <li class="ax"><a href="?p=admin&c=Connect&a=List">友情链接</a></li>
                        <li class="ax"><a href="?p=admin&c=User&a=List">用户管理</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="admin-bread">
            <span>您好，<?php echo $_SESSION['user_name'];?>，欢迎您的光临。</span>
            <ul class="bread">
                <li><a href="?p=admin" class="icon-home"> 开始</a></li>
                <li>后台首页</li>
            </ul>
        </div>
    </div>
</div>

<div class="admin">
    <div class="tab">
        <div class="tab-head"> <strong><a href="?p=admin&c=Article&a=List">文章管理</a> </strong>
            <ul class="tab-nav">
                <li class="active"><a href="#tab-set">修改文章</a></li>
            </ul>
        </div>
        <div class="tab-body"> <br />
            <div class="tab-panel active" id="tab-set">
                <form method="POST" class="form-x" action="?p=admin&c=Article&a=modify" enctype="multipart/form-data">
                    <div class="form-group">
                        <div class="label">
                            <label for="sitename">文章标题</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="title" name="title" size="50" value="<?php echo $data['art_title'];?>" data-validate="required:请填写您的文章标题" />
                        </div>
                    </div>
                    <input type="hidden" value="<?php echo$art_id;?>" name="art_id">
                    <div class="form-group">
                        <div class="label">
                            <label for="siteurl">文章作者</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="author" name="author" size="50"   value="<?php echo $data['art_name'];?>" data-validate="required:请填写文章作者" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label for="sitename">所属类别</label>
                        </div>
                        <div class="field">
                            <select name="cateid" class="select">
                                <?php foreach ($date as $value):?>
                                <?php if($data['col_id'] == $value['col_id']):?>
                                <option selected value="<?php echo $value['col_id'];?>"><?php echo $value['col_content'];?></option>
                                <?php else:?>
                                <option  value="<?php echo $value['col_id'];?>"><?php echo $value['col_content'];?></option>
                                <?php endif ?>
                                <?php endforeach ?>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label for="readme">文章内容</label>
                        </div>
                        <div class="field">
                            <?php $content = $data['art_content'];?>
                            <div id="div1"><?php echo$content;?> </div>
                            <textarea hidden   id="text1" style="width:100%; height:200px;" name="content"><?php echo$content;?> </textarea>
                            <script type="text/javascript">
                                var E = window.wangEditor
                                var editor = new E('#div1')
                                var $text1 = $('#text1')
                                editor.customConfig.onchange = function (html) {
                                    // 监控变化，同步更新到 textarea
                                    $text1.val(html)
                                }
                                editor.customConfig.uploadImgShowBase64 = true   // 使用 base64 保存图片
                                editor.create()
                                // 初始化 textarea 的值
                            </script>
                        </div>
                    </div>
                    <div class="form-button">
                        <button name="submit" class="button bg-main" type="submit">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div style='height:40px; border-bottom:1px #DDD solid'></div>
    <p class="text-right text-gray" style="float:right">基于<a class="text-gray" target="_blank" href="#">MVC框架</a>构建</p>
</div>
</body>
</html>
<script>
    function a() {
        var text = document.getElementById('text1').value;
    }
    a();
</script>